package com.iaiai.tm.activity;

import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * 
 * <p>
 * Title: PerformanceLinearLayout.java
 * </p>
 * <p>
 * E-Mail: 176291935@qq.com
 * </p>
 * <p>
 * QQ: 176291935
 * </p>
 * <p>
 * Http: iaiai.iteye.com
 * </p>
 * <p>
 * Create time: 2012-2-10 下午1:31:03
 * </p>
 * 
 * @author 丸子
 * @version 0.0.1
 */
public class PerformanceLinearLayout extends LinearLayout {
	
	private Context context;

	/**
	 * @param context
	 * @param attrs
	 */
	public PerformanceLinearLayout(Context context, AttributeSet attrs) {
		super(context, attrs);
		
		this.context = context;
		
		init();
	}
	
	/**
	 * @param context
	 * @param attrs
	 */
	public PerformanceLinearLayout(Context context) {
		super(context);
		
		this.context = context;
		
		init();
	}
	
	private void init(){
		LinearLayout layout = new LinearLayout(context);
		layout.setOrientation(LinearLayout.VERTICAL);
		
		TextView cpuTextView = new TextView(context);
//		cpuTextView.setBackgroundColor(Color.WHITE);
//		cpuTextView.setTextColor(Color.BLACK);
		cpuTextView.setText("CPU使用记录");
		layout.addView(cpuTextView);
		
		CpuGraphView cpuView = new CpuGraphView(context);
		layout.addView(cpuView,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.FILL_PARENT,1));
		
		TextView memTextView = new TextView(context);
//		memTextView.setBackgroundColor(Color.WHITE);
//		memTextView.setTextColor(Color.BLACK);
		memTextView.setText("物理内存使用记录");
		layout.addView(memTextView);
		
		MemGraphView memView = new MemGraphView(context);
		layout.addView(memView,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.FILL_PARENT,1));
		
		addView(layout);
	}
	
}
